#include "../h/Bank.h"
#include "../h/ObjectsContainer.h"


Bank::Bank()
{
	bankAcounts = new ObjectsContainer();
}

Bank::~Bank()
{
	this->clear();
}

void Bank::clear()
{
	//bankAcounts->clear();
	delete bankAcounts;
	bankAcounts = 0;
}

void Bank::deposit(string name,double amount)
{
	bankAcounts->add(name,amount);
}

void Bank::withdraw(string name,double amount)
{
	bankAcounts->remove(name,amount);
}

double Bank::getUserStatus(string name)
{
	return(bankAcounts->getNameAmount(name));
}
